home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Art / Art Tools / View Picture 1.0.0.sit / View Picture 1.0.0 / README / README
Encoding:
Text File  |  1995-05-07  |  9.2 KB  |  141 lines  |  [TEXT/ttxt]

  1. View Picture Documentation—1.0.0
  2. View Picture is a utility for viewing, cropping, and compressing pictures (if QuickTime is available). It is scriptable and recordable, and supports drag-and-drop (if available) and balloon help. It requires system 7.0 or higher. View Picture uses an intelligent algorithm for cropping pictures that determines how many colors are required and doesn't use a deeper bitmap than necessary.
  3.  
  4. Please report any bugs (not described in this documentation) to geoffk@ozemail.com.au.
  5.  
  6. Most of what view picture does is obvious, and there's always balloon help—but you should read the legal information at the end of this document. The only thing that might not be obvious is how to script it:
  7.  
  8. Scripting View Picture
  9.  
  10. View Picture fully supports the Core and Required Suites (with one exception relating to selections). It also supports the cut, copy, and paste events, and transactions.
  11.  
  12. The exception for selections is that selections in View Picture do not contain object specifiers. To get an object specifier for a selection, you use get the contents of selection as reference (or similar to get the selection of a particular document, get the contents of the selection of window 1 as reference—see bugs below). To set the selection, use set the selection to some picture of document 1 or similar.
  13.  
  14. View Picture also supports a few events and object classes of its own. All of these are fully described in its dictionary (which I've pasted in from Script Editor and put below), except for the way you select picture objects. To get the entire picture of a document, you can write ‘some picture of document 1’ (or send an equivalent event using some other method) but you can also get parts of pictures. AppleScript doesn't support this. From a programming language, you create an object specifier record, with:
  15. keyAEDesiredClass: 'PICT'
  16. keyAEContainer: object specifier records for the picture document or picture that contains this picture
  17. keyAEKeyForm: pBounds
  18. keyAEKeyData: a rectangle, typeRectangle, containing the coordinates than enclose the part of the picture this record is to reference.
  19.  
  20. This lets you get and copy pictures without having to change the selection (as you would have to to get equivalent functionality from AppleScript).
  21.  
  22. View Picture suite: Suite for things specific to View Picture
  23.  
  24. compress: Make a picture into a bitmap
  25.     compress  reference  -- the picture to compress
  26.         [compressor  JPEG/none/graphics/run length encoding]  -- the kind of compressor to use
  27.         [quality  lossless/maximum/high/normal/low/minimum]  -- the amount of compression to do
  28.  
  29. make bitmap: Make a picture into a bitmap
  30.     make bitmap  reference  -- the picture to make into a bitmap
  31.  
  32. Class about box: The document produced by choosing ‘About…’
  33. Elements:
  34.     window by numeric index, by ID, by name, satisfying a test
  35. Properties:
  36.     about picture  picture  [r/o]  -- the picture in the box
  37.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  38.     class  type class  [r/o]  -- the class of this object
  39.     default type  type class  [r/o]  -- the default data type for this object
  40.     id  integer  [r/o]  -- the (unique) id number of this object
  41.     index  integer  -- the number of the document
  42.     modified  boolean  [r/o]  -- Has the document been modified since the last save?
  43.     name  string  [r/o]  -- the name of the document
  44.  
  45. Class picture document: A document containing a picture
  46. Elements:
  47.     window by numeric index, by ID, by name, satisfying a test
  48.     picture by numeric index, 'pbnd'
  49. Properties:
  50.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  51.     class  type class  [r/o]  -- the class of this object
  52.     default type  type class  [r/o]  -- the default data type for this object
  53.     id  integer  [r/o]  -- the (unique) id number of this object
  54.     index  integer  -- the number of the document
  55.     modified  boolean  [r/o]  -- Has the document been modified since the last save?
  56.     name  string  [r/o]  -- the name of the document
  57.  
  58. Class picture: A QuickDraw picture
  59. Elements:
  60.     picture 'pbnd'
  61. Properties:
  62.     arcs  integer  [r/o]  -- the number of arcs in this picture
  63.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  64.     bitmaps  integer  [r/o]  -- the number of bitmaps in this picture
  65.     bounds  bounding rectangle  [r/o]  -- the boundary rectangle for the picture
  66.     class  type class  [r/o]  -- the class of this object
  67.     comments  integer  [r/o]  -- the number of picture comments in this picture
  68.     default type  type class  [r/o]  -- the default data type for this object
  69.     depth  integer  [r/o]  -- the maximum number of bits per pixel required for this picture
  70.     horizontal resolution  fixed  [r/o]  -- the number of pixels per inch for this picture in the horizontal direction
  71.     lines  integer  [r/o]  -- the number of lines in this picture
  72.     ovals  integer  [r/o]  -- the number of ovals in this picture
  73.     pixmaps  integer  [r/o]  -- the number of pixmaps in this picture
  74.     polygons  integer  [r/o]  -- the number of polygons in this picture
  75.     rounded rectangles  integer  [r/o]  -- the number of rounded rectangles in this picture
  76.     rectangles  integer  [r/o]  -- the number of rectangles in this picture
  77.     regions  integer  [r/o]  -- the number of QuickDraw regions in this picture
  78.     texts  integer  [r/o]  -- the number of text strings in this picture
  79.     complexity  unknown/original/color/extended/compressed  [r/o]  -- an indicator of the complexity of this picture
  80.     unique colors  integer  [r/o]  -- the number of different colors in this picture
  81.     unique comments  integer  [r/o]  -- the number of different comments in this picture
  82.     unique fonts  integer  [r/o]  -- the number of different fonts in this picture
  83.     vertical resolution  fixed  [r/o]  -- the number of pixels per inch for this picture in the vertical direction
  84.  
  85.  
  86. Known bugs in View Picture:
  87. - the picture in a new document is solid black on a black-and-white display (and doesn't look too good in 2-bit or 4-bit color either).
  88. - view picture doesn't always recognise certain compressed pictures as compressed (because it uses the wrong algorithm to determine if a picture is compressed or not). As well as affecting display of the menus, this can cause problems with cropping and conversion of pictures to bitmaps; view picture can estimate the number of bits per pixel required to be much lower than it should be (for instance, 1 bit, for a partly JPEG-compressed picture).
  89. - saving documents isn't really well thought out; for one thing, the ‘do you want to save’ dialog shouldn't mention the name of a picture if it doesn't have one.
  90. - view picture always zooms a window to the main display, not the display it's currently on.
  91.  
  92. View picture has been tested under system 7.0.1, 7.1.0 and 7.1.2. There is no reason it should have problems on system 7.5.1, or on 7.5.0 (but you shouldn't be running 7.5.0, it has many bugs). It has been tested on an SE, on a Classic II, and on a Power Macintosh 6100/60, so it would be surprising if there was a configuration it doesn't run on.
  93.  
  94. Known bugs in other software:
  95. - when a window is closed in view picture, it doesn't release the colors it was using, so (amongst other things) icons in the finder go to black-and-white. Workaround: quit view picture.
  96. - the following script doesn't work properly in AppleScript:
  97.  
  98. tell application "view picture"
  99.     activate
  100.     set the selection to some picture of document 1
  101.     get the contents of selection as reference
  102. end tell
  103.  
  104. (the result it produces is not properly decoded by AppleScript; and you can't paste that result back into a script either.)
  105. You need to use:
  106.  
  107. tell application "view picture"
  108.     activate
  109.     set the selection to some picture of document 1
  110.     get the bounds of the contents of selection
  111. end tell
  112.  
  113. - The following script won't compile in AppleScript:
  114.  
  115. tell application "view picture"
  116.     activate
  117.     get every property of document 1
  118. end tell
  119.  
  120. You need to substitute “«class prop»” for “property” to make it compile, but AppleScript decompiles the resulting script to the above.
  121. - the following script doesn't do what you'd like:
  122.  
  123. tell application "view picture"
  124.     activate
  125.     get every property of document 1 as reference
  126. end tell
  127.  
  128. (and doesn't compile). It comes close, though; the partial result is what you probably wanted.
  129. - SimpleText insists on showing the scripts above in color, and doesn't let you turn it off.
  130.  
  131. Legal Notice and Licence
  132. The author does not claim that View Picture is suitable for any purpose whatsoever. Because View Picture is provided free of charge, no warranty is provided. The author accepts no liability or responsibility of any sort for any loss or damage resulting from the use or operation of this software.
  133.  
  134. This documentation is Copyright 1995 Geoffrey Keating. All rights are reserved. You (the reader) are licensed to distribute unmodified copies of this documentation.
  135.  
  136. View Picture bears the following copyright notice and license:
  137.  
  138. “View Picture is Copyright 1994-1995 Geoffrey Keating. All rights are reserved.
  139.  
  140. You (the reader) are licensed to use this software and to distribute unmodified copies of this software, on condition that you not attempt to decompile, reverse engineer, or otherwise attempt to reduce this software to a human-readable form. By using this software you are taken to agree to the terms of this license.”
  141.